{layout name="formlayout" /}

<div class="layui-form" lay-filter="layuiadmin-form-useradmin" id="layuiadmin-form-useradmin" style="padding: 20px">
    <div class="layui-form-item">
        <label class="layui-form-label">文章标题</label>
        <div class="layui-input-block">
            <input type="text" name="title" value="{$item.title}" lay-verify="required" placeholder="请输入文章标题"
                autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">分类</label>
        <div class="layui-input-block">
            <select name="cateId" lay-verify="required">
                <option value=""></option>
                {volist name="cates" id="val"}
                <option value="{$val.id}" {if ($val.id==$item.cateId)} selected{/if}>{$val.name}</option>
                {/volist}
            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <label for="" class="layui-form-label">内容</label>
        <div class="layui-input-block">
            <script id="container" name="content" type="text/plain"></script>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">是否显示</label>
        <div class="layui-input-block">
            <input type="radio" name="isShow" lay-verify="required" title="显示" value="1" class="layui-input" {if ($item.isShow)} checked="checked" {/if}>
            <input type="radio" name="isShow" lay-verify="required" title="隐藏" value="0" class="layui-input" {if (!$item.isShow)} checked="checked" {/if}>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">初始阅读量</label>
        <div class="layui-input-block">
            <input type="text" name="count" value="{$item.count|default=0}" lay-verify="required" autocomplete="off"
                class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">排序</label>
        <div class="layui-input-block">
            <input type="text" name="order" value="{$item.order|default=100}" lay-verify="required"
                autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item layui-hide">
        <input type="hidden" name="id" value="{$item.id}">
        <input type="button" lay-submit lay-filter="zbc-article-submit" id="zbc-article-submit" value="确认">
    </div>
</div>
<!-- 配置文件 -->
<script type="text/javascript" src="/ue/ueditor.config.js"></script>
<!-- 编辑器源码文件 -->
<script type="text/javascript" src="/ue/ueditor.all.js"></script>
<script>
    layui.config({
        base: '/static/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'form'], function () {
        var $ = layui.$
            , form = layui.form;
        $(function () {
            window.ue = UE.getEditor('container');
            ue.ready(function(){
                ue.setContent('{$item.content|raw}')
            })
        })
    })
</script>